﻿namespace IntegrationTests
{
    using System.Collections.Generic;
    using DirectoryServicesProtocolsExtensions.MetaData;
    using DirectoryServicesProtocolsExtensions.MetaData.SemanticAttributeGroupings;

    class MockMetaDataPropertiesContainer : ILdapMetaDataPropertiesContainer
    {
        private static GuidEncodedAttributeGroup guidEncodedAttributeGroup =
            new GuidEncodedAttributeGroup(new List<string> { "objectGUID" });

        private static SidEncodedAttributeGroup sidEncodedAttributeGroup =
            new SidEncodedAttributeGroup(new List<string> { "objectSID" });

        private static Int64DateTimeEncodedAttributeGroup int64DateTimeEncodedAttributeGroup =
            new Int64DateTimeEncodedAttributeGroup(new List<string>
        {
            "lastLogonTimestamp", "lastLogon", "pwdLastSet", "accountExpires"
        });

        private static StringEncodedIntAttributeGroup stringEncodedIntAttributeGroup =
            new StringEncodedIntAttributeGroup(new List<string> { "userAccountControl" });

        private static AttributesWhichMayRequireExpansionGroup attributesWhichMayRequireExpansionGroup =
            new AttributesWhichMayRequireExpansionGroup(new List<string> { "member" });

        public int MaxStringAllocationSize
        {
            get { return 256; }
        }
        public Int64DateTimeEncodedAttributeGroup Int64EncodedAttributeDateTimeAttributes
        {
            get { return int64DateTimeEncodedAttributeGroup; }
            set { int64DateTimeEncodedAttributeGroup = value; }
        }
        public GuidEncodedAttributeGroup GuidEncodedAttributeBinaryAttributes
        {
            get { return guidEncodedAttributeGroup; }
            set { guidEncodedAttributeGroup = value; }
        }
        public SidEncodedAttributeGroup SidEncodedAttributeBinaryAttributes
        {
            get { return sidEncodedAttributeGroup; }
            set { sidEncodedAttributeGroup = value; }
        }
        public StringEncodedIntAttributeGroup StringEncodedIntAttributes
        {
            get { return stringEncodedIntAttributeGroup; }
            set { stringEncodedIntAttributeGroup = value; }
        }
        public AttributesWhichMayRequireExpansionGroup AttributesWhichMayRequireExpansion
        {
            get { return attributesWhichMayRequireExpansionGroup; } 
            set { attributesWhichMayRequireExpansionGroup = value; }
        }
    }
}
